#!/bin/bash
# 检查QEMU设备树信息

echo "检查QEMU virt平台设备树信息..."
qemu-system-riscv64 -machine virt,dumpdtb=virt.dtb -nographic &
QEMU_PID=$!
sleep 1
kill $QEMU_PID 2>/dev/null

if [ -f virt.dtb ]; then
    echo "设备树信息："
    dtc -I dtb -O dts virt.dtb | grep -A5 -B5 "uart\|memory"
    rm -f virt.dtb
else
    echo "无法生成设备树文件，请检查QEMU安装"
fi